<template>
  <div class="search">
    <f-form ref="form" :action="api.guestrecord" :form-key="this.formItem.guestrecordId" >
      <f-form-item label="（服务类型，1接机，2送机）"  name="serverType" dataType="number"   :value="formItem.serverType" />
      <f-form-item label=""  name="appointmentState" dataType="number"   :value="formItem.appointmentState" />
      <f-form-item label="企业名称"  name="enterpriseName" dataType="${formField.dataType}"   :value="formItem.enterpriseName" />
      <f-form-item label="航班号"  name="flightNumber" dataType="${formField.dataType}"   :value="formItem.flightNumber" />
      <f-form-item label="起飞时间"  name="takeOffTime" dataType="${formField.dataType}"   :value="formItem.takeOffTime" />
      <f-form-item label="始发地"  name="originatingPlace" dataType="${formField.dataType}"   :value="formItem.originatingPlace" />
      <f-form-item label="到达地"  name="destinationPlace" dataType="${formField.dataType}"   :value="formItem.destinationPlace" />
      <f-form-item label="车牌号"  name="plateNumber" dataType="${formField.dataType}"   :value="formItem.plateNumber" />
      <f-form-item label="备注"  name="remark" dataType="${formField.dataType}"   :value="formItem.remark" />
      <f-form-item label="会员卡号"  name="vipCardNo" dataType="${formField.dataType}"   :value="formItem.vipCardNo" />
      <f-form-item label="原卡号"  name="oldVipCardNo" dataType="${formField.dataType}"   :value="formItem.oldVipCardNo" />
      <f-form-item label="使用人"  name="userName" dataType="${formField.dataType}"   :value="formItem.userName" />
      <f-form-item label="预约人"  name="appointmentName" dataType="${formField.dataType}"   :value="formItem.appointmentName" />
      <f-form-item label="预约时间"  name="appointmentDate" dataType="${formField.dataType}"   :value="formItem.appointmentDate" />
      <f-form-item label="联系电话"  name="appointmentPhone" dataType="${formField.dataType}"   :value="formItem.appointmentPhone" />
      <f-form-item label="预约成功失败操作者"  name="optUserId" dataType="${formField.dataType}"   :value="formItem.optUserId" />
      <f-form-item label="是否推送"  name="isNotice" dataType="number"   :value="formItem.isNotice" />
      <f-form-item label="通知方式"  name="noticeWay" dataType="number"   :value="formItem.noticeWay" />
      <f-form-item label="处理日期"  name="optDate" dataType="${formField.dataType}"   :value="formItem.optDate" />
      <f-form-item label="是否删除"  name="deleted" dataType="number"   :value="formItem.deleted" />
      <f-form-item label="更新人"  name="updateUser" dataType="${formField.dataType}"   :value="formItem.updateUser" />
      <f-form-item label="更新时间"  name="updateTime" dataType="${formField.dataType}"   :value="formItem.updateTime" />
      <f-form-item label="创建人"  name="createUser" dataType="${formField.dataType}"   :value="formItem.createUser" />
      <f-form-item label="创建时间"  name="createTime" dataType="${formField.dataType}"   :value="formItem.createTime" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'guestrecordForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          guestrecordId: '',
          serverType: '',
          appointmentState: '',
          enterpriseName: '',
          flightNumber: '',
          takeOffTime: '',
          originatingPlace: '',
          destinationPlace: '',
          plateNumber: '',
          remark: '',
          vipCardNo: '',
          oldVipCardNo: '',
          userName: '',
          appointmentName: '',
          appointmentDate: '',
          appointmentPhone: '',
          optUserId: '',
          isNotice: '',
          noticeWay: '',
          optDate: '',
          deleted: '',
          updateUser: '',
          updateTime: '',
          createUser: '',
          createTime: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.guestrecordId) {
          let params={
              guestrecordId:data.guestrecordId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
